package com.example.hospitalsystem.controller;

import com.example.hospitalsystem.pojo.dto.admin.AdminDto;
import com.example.hospitalsystem.pojo.entity.Admin;
import com.example.hospitalsystem.result.Result;
import com.example.hospitalsystem.service.AdminService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("admin")
@Tag(name="12.管理员模块")
public class AdminController {


    @Autowired
    private AdminService adminService;

    @Operation(summary = "完善管理员信息",security = {@SecurityRequirement(name = "Authorization")})
    @PutMapping("/completeEditAdmin")
    public Result completeEditAdmin(@RequestBody AdminDto adminDto){
        return adminService.completeEditAdmin(adminDto);
    }

    @Operation(summary = "编辑管理员信息",security = {@SecurityRequirement(name = "Authorization")})
    @PostMapping("/editAdmin")
    public Result editAdminInfo(@RequestBody Admin admin){
        return adminService.editAdminInfo(admin);
    }

    @Operation(summary = "管理员获取个人信息",security = {@SecurityRequirement(name = "Authorization")})
    @GetMapping("/getAdmin")
    public Result getAdminInfo(){
        return adminService.getAdminOne();
    }

}
